﻿using CommunicationProtocol.dto;
using CommunicationProtocol.filters;
using server.filter;
using server.filters;
using server.gameLogic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace server
{
    public class ClientMetaData
    {

        public List<NetFilter> outband { get; }

        public List<NetFilter> inband { get;  }

        public string userId { get; set; }
  

        public ClientMetaData(SocketSenderFilter socketSenderFilter)
        {
            outband = new List<NetFilter>();
            outband.Add(new CommandEncoder());
            outband.Add(new EncodeFrameFilter());
            outband.Add(socketSenderFilter);

            inband = new List<NetFilter>();
            inband.Add(new DecodeFrameFilter());
            inband.Add(new LoginFilter());
            inband.Add(new RequestDecoderFilter());


        }

        internal void write(Command command)
        {
            new InvocationChain(outband).invoke(command);
        }
    }
}
